import 'package:flutter/material.dart';
import 'package:flutterapp2/extension/extension.dart';
import 'package:flutterapp2/util/image_util.dart';

class SpecialHouseItemWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Padding(
        padding: const EdgeInsets.symmetric(vertical: 20),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Stack(
              alignment: Alignment.topLeft,
              children: <Widget>[
                Image.asset(
                  ImageUtil.getImagePath("bg_holder"),
                  fit: BoxFit.cover,
                  width: double.infinity,
                  height: double.infinity,
                ),
                Container(
                  decoration: BoxDecoration(
                    color: Color(0xFF21C1B5),
                    borderRadius: BorderRadius.circular(1),
                  ),
                  padding: EdgeInsets.all(3),
                  child: Text(
                    "在售?",
                    style: TextStyle(fontSize: 11, color: Colors.white),
                  ),
                ),
              ],
            )
                .size(
                  width: 100,
                  height: 80,
                )
                .padding(EdgeInsets.only(top: 5)),
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Row(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Text(
                      "1102号楼3单元106?",
                      style: TextStyle(
                        fontSize: 16,
                        fontWeight: FontWeight.bold,
                        color: Color(0xFF222222),
                      ),
                    ).expanded(),
                    Text(
                      "审核中?",
                      style: TextStyle(
                        fontSize: 12,
                        color: Color(0xFFFE730F), // todo 根据状态设置颜色
                      ),
                    ).padding(EdgeInsets.only(top: 2)),
                  ],
                ),
                Text(
                  "3室1厅1卫?",
                  style: TextStyle(
                    fontSize: 12,
                    color: Color(0xFF222222),
                  ),
                ).padding(const EdgeInsets.only(top: 3)),
                Row(
                  children: <Widget>[
                    Text(
                      "600?",
                      style: TextStyle(
                        fontSize: 16,
                        color: Color(0xFFFF614C),
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    Text(
                      "万",
                      style: TextStyle(
                        fontSize: 14,
                        color: Color(0xFFFF614C),
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    Text(
                      "600万?",
                      style: TextStyle(
                        fontSize: 16,
                        color: Color(0xFF999999),
                        decoration: TextDecoration.lineThrough,
                        decorationColor: const Color(0xFF999999),
                      ),
                    ).padding(EdgeInsets.only(left: 6)),
                  ],
                ).padding(const EdgeInsets.only(top: 2)),
                Text(
                  "有效时间：2020.04.15-直到售罄?",
                  maxLines: 1,
                  overflow: TextOverflow.ellipsis,
                  style: TextStyle(
                    fontSize: 12,
                    color: Color(0xFF999999),
                  ),
                ),
              ],
            ).padding(const EdgeInsets.only(left: 15)).expanded(), /// 三层嵌套时，内部使用expanded在父容器的父容器也加个expanded才可以。
          ],
        ));
  }
}
